package com.css.crm.dao.impl;

import java.util.List;
import org.apache.ibatis.session.SqlSession;
import com.css.crm.dao.CustomerServiceEventDao;
import com.css.crm.vo.CustomerServiceEventVo;

/**
 * Implementation for CustomerServiceEventDao
 * 
 * @author AIS
 */
public class CustomerServiceEventDaoImpl extends BaseDaoImpl implements CustomerServiceEventDao {

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerServiceEventDao#getCustomerServiceEventByCustId
	 * (java.lang.String)
	 */
	@Override
	public List<CustomerServiceEventVo> getCustomerServiceEventByCustId(String custId) {
		SqlSession session = getMyBatisSession();
		return session.selectList("customerServiceEvent.getCustomerServiceEventByCustId", custId);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerServiceEventDao#insertCustomerServiceEvent(com
	 * .css.crm.vo.CustomerServiceEventVo)
	 */
	@Override
	public int insertCustomerServiceEvent(CustomerServiceEventVo customerServiceEvent) {
		SqlSession session = getMyBatisSession();
		return session.insert("customerServiceEvent.insertCustomerServiceEvent", customerServiceEvent);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerServiceEventDao#updateCustomerServiceEventByPK
	 * (com.css.crm.vo.CustomerServiceEventVo)
	 */
	@Override
	public int updateCustomerServiceEventByPK(CustomerServiceEventVo customerServiceEvent) {
		SqlSession session = getMyBatisSession();
		return session.update("customerServiceEvent.updateCustomerServiceEventByPK", customerServiceEvent);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerServiceEventDao#deleteCustomerServiceEventByPK
	 * (java.lang.Long)
	 */
	@Override
	public int deleteCustomerServiceEventByPK(Long custServEventId) {
		SqlSession session = getMyBatisSession();
		return session.delete("customerServiceEvent.deleteCustomerServiceEventByPK", custServEventId);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerServiceEventDao#deleteCustomerServiceEventByCustId
	 * (java.lang.String)
	 */
	@Override
	public int deleteCustomerServiceEventByCustId(String custId) {
		SqlSession session = getMyBatisSession();
		return session.delete("customerServiceEvent.deleteCustomerServiceEventByCustId", custId);
	}
}
